import { http } from '@/tool/utils'
import { iPb } from '@/protobuf/interface'

export function ListMemberGroup(data: iPb.Admin.IListMemberGroupRequest):Promise<iPb.Admin.IListMemberGroupResponse> {
    return http.post("ListMemberGroup",iPb.Admin.ListMemberGroupRequest.toObject(iPb.Admin.ListMemberGroupRequest.create(data)))
}

export function CreateMemberGroup(data: iPb.IDbMemberGroup):Promise<iPb.Admin.ICreateMemberGroupResponse> {
    return http.post("CreateMemberGroup",iPb.DbMemberGroup.toObject(iPb.DbMemberGroup.create(data)))
}

export function UpdateMemberGroup(data: iPb.IDbMemberGroup):Promise<iPb.Admin.IUpdateMemberGroupResponse> {
    return http.post("UpdateMemberGroup",iPb.DbMemberGroup.toObject(iPb.DbMemberGroup.create(data)))
}

export function ReadMemberGroup(formData: iPb.Admin.IReadMemberGroupRequest):Promise<iPb.IDbMemberGroup> {
    return http.post("ReadMemberGroup",iPb.Admin.ReadMemberGroupRequest.create(formData))
}

export function DeleteMemberGroup(formData: iPb.Admin.IDeleteMemberGroupRequest):Promise<iPb.Admin.IDeleteMemberGroupResponse> {
    return http.post("DeleteMemberGroup",iPb.Admin.DeleteMemberGroupRequest.create(formData))
}